{% extends "page_base.html" %}

{% block content %}

{% for category in data %}
	<h2><font color="Aqua">Category: {{category.name|title|safe}}</font></h2>
	
	{% if category.aux_encyclopedia_urls or category.isi_url %}
		<div class="block topborder">

		<h3>Confirmed Sources</h3>

		{% if category.aux_encyclopedia_urls %}
			<div class="pane">
			<h4>Encyclopedia</h4>
			{% for aux in category.aux_encyclopedia_urls %}
				<div class="category">
				<a class="clean" href="{{ aux.reference }}">
				<img src="/images/{{aux.type|lower}}.ico"/>
				{{ aux.type }}
				</a>
				</div>
			{% endfor %}
			</div>
		{% endif %}

		{% if category.isi_url %}
			{% for isi_url in category.isi_url%}
			<div class="pane">
			<h4>Definition</h4>	
			<div class="category">
			<a class="clean" href="{{ isi_url.reference }}">
			<img src="/images/isi.ico"/>
			ISI
			</a>
			</div>
			</div>
			{% endfor %}
		{% endif %}

		</div>
	{% endif %}


	{% if category.parents or category.children or category.related %}
		<div class="block topborder">

		<h3>Topic Hierarchy</h3>

		{% if category.parents %}
			<div class="pane">
			<h4>Parents</h4>
			{% for parent in category.parents %}
				<a href="/{{parent.id|safe}}">{{ parent.name|capfirst|safe }}</a>{% if not forloop.last %}, {% else %}.{% endif %}
				<!-- <em>source:</em> "{{ child.source }}" -->
			{% endfor %}
			</div>
		{% endif %}

		{% if category.children %}
			<div class="pane">
			<h4>Children</h4>
			{% for child in category.children %}
				<a href="/{{child.id|safe}}">{{ child.name|capfirst|safe }}</a>{% if not forloop.last %}, {% else %}.{% endif %}
				<!-- <em>source:</em> "{{ source }}" -->
			{% endfor %}
			</div>
		{% endif %}
	
		{% if category.related %}
			<div class="pane">
			<h4>Related</h4>
			{% for related in category.related %}
				<a href="/{{related.id|safe}}">{{ related.name|capfirst|safe }}</a>{% if not forloop.last %}, {% else %}.{% endif %}
				<!-- <em>source:</em> "{{ source }}" -->
			{% endfor %}
			</div>
		{% endif %}

		</div>
	{% endif %}
{% endfor %}


{% if references_book or references_lecture %}
	<div class="block topborder">
	<h3>References</h3>
	{% if references_book %}
		<div class="references_book"> 
		<h4>Books</h4>
			{% for book,pages in references_book %}
				<a href="/{{ book.id|safe }}">{{ book.title|title|safe }}</a>{% if pages %}: <em>Page #</em> {{ pages|join:", "}}.{% endif %}<br/>
			{% endfor %}
		</div>
	{% endif %}
	{% if references_lecture %}
		<div class="references_lecture">
		<h4>Courses</h4>
			{% for course,lectures in references_lecture %}
				<a href="/{{ course.id}}/lecture/">
					{% if course.semester %}[{{course.semester}}] {% endif%}
					{% if course.name %}{{course.name}} {% endif%}
					{% if course.description %} -- {{course.description}}{% endif%}
				</a>: <em>Lecture #</em> 
				{% for lecture in lectures %}
					{% if lecture.source %}<a href="{{ lecture.source|safe}}">{{ lecture.lecture_num }}</a>{% else %}{{ lecture.lecture_num }}{% endif %}{% if not forloop.last %}, {% else %}.<br/>{% endif %}
				{% endfor %}
			{% endfor %}
		</div>
	{% endif %}
	</div>
{% endif %}



{% if practitioners%}
	<div class="block topborder">

	<h3>Practitioners</h3>

	{% for p in practitioners %}
		<div class="category">
		<a href="http://mathpeople.statbib.org/people?q={{ p.first_name|safe }}%20{{ p.last_name|safe }}">
		{{ p.first_name|safe }} {{ p.last_name|safe }}</a>{% if p.source %}, <em>source:</em> "{{ p.source }}{% endif %}"
		</div>
	{% endfor %}

	</div>
{% endif %}



<div class="block topborder">
<h3>Scripted Searches</h3>

<div class="pane">
<h4>Article Search</h4>

<div class="category">
<a class="clean" href="http://cis.statbib.org/articles/search?q={{topic.name|urlencode}}">
<img src="/images/cis.ico"/>
CIS
</a>
</div>

<div class="category">
<a class="clean" href="http://scholar.google.com/scholar?q={{topic.name|urlencode}}">
<img src="/images/google.ico"/>
Google Scholar
</a>
</div>

<div class="category">
<a class="clean" href="http://www.zentralblatt-math.org/zmath/en/search/?q={{topic.name|urlencode}}">
<img src="/images/zmath.ico"/>
Zmath
</a>
</div>

</div>


<div class="pane">
<h4>Web Search</h4>

<div class="category">
<img src="/images/google.ico"/>
<a class="clean" href="http://www.google.com/search?q={{topic.name|urlencode}}">Google</a>
</div>

<div class="category">
<img src="/images/microsoft.ico"/>
<a class="clean" href="http://search.live.com/results.aspx?q={{topic.name|urlencode}}">Microsoft</a>
</div>

<div class="category">
<img src="/images/yahoo.ico"/>
<a class="clean" href="http://search.yahoo.com/search?p={{topic.name|urlencode}}">Yahoo</a>
</div>

</div>


</div>


<div style="height:12em;"></div>


{% endblock %}
